package org.fujene.structure;

import org.fujene.toolbox.ContentHash;

public class IndexQueue{
	public Enumerates type;
	public long ID;
	public int from;
	public int length;
	public String value;
	// インデックス方法
	public int indexType;
	// 文章種類
	public int valueType;
	public long option;
	public long hash;

	public IndexQueue(Enumerates type, String value){
		this.type = type;
		this.value = value;
		setHash();
	}

	public IndexQueue(Enumerates type, String value, long ID){
		this.type = type;
		this.value = value;
		this.ID = ID;
		setHash();
	}

	public IndexQueue(Enumerates type, String value, long ID, int indexType){
		this(type, value, -1, ID, indexType);
		setHash();
	}

	public IndexQueue(Enumerates type, String value, long hash, long ID, int indexType){
		this.type = type;
		this.value = value;
		this.hash = hash;
		this.ID = ID;
		this.indexType = indexType;
	}

	public IndexQueue(Enumerates type, String value, long ID, int indexType, int valueType){
		this.type = type;
		this.value = value;
		this.ID = ID;
		this.indexType = indexType;
		this.valueType = valueType;
		setHash();
	}

	public IndexQueue(Enumerates type, String value, long ID, long time){
		this.type = type;
		this.value = value;
		this.option = time;
		setHash();
	}

	public IndexQueue(Enumerates type, String value, int from, int length, long debug){
		this.type = type;
		this.value = value;
		this.from = from;
		this.length = length;
		this.option = debug;
		setHash();
	}

	// ハッシュ設定
	public void setHash(){
		if (this.value != null) this.hash = ContentHash.getTermHash(this.value);
	}

}
